package com.jwinni.IO.BufferedInputAndOutputStream;
import java.io.*;

/*
* 缓冲流
* */
public class DemeCopyFile {
    public static void main(String[] args) {
        BufferedInputStream bis=null;
        BufferedOutputStream bos=null;
        try {
        //创建字节缓冲输入//创建字节缓冲输出流
         bis = new BufferedInputStream(new FileInputStream("static/a.txt"));
         bos= new BufferedOutputStream(new FileOutputStream("static/cd.txt"));
            byte[] bytes = new byte[10240];
            int len =0;
            while ((len=bis.read(bytes)) !=-1){
                bos.write(bytes,0,len);
            }

        }catch (IOException e){


        }
        finally {
            try {

                bis.close();
                bos.close();
            }
            catch (IOException r)
            {

            }

        }
    }

}
